package teacher.core;

import java.util.ArrayList;
import java.util.List;

import teacher.custom.FirstInterceptor;
import teacher.custom.LoginAction;
import teacher.custom.SecondInterceptor;
import teacher.custom.SuccessResult;
import teacher.custom.ThirdInterceptor;

public class DefaultActionProxy implements ActionProxy {
//	private ConfigurationManager manager;	
	
	public String execute() {
		DefaultActionInvocation actionInvocation = new DefaultActionInvocation();
		actionInvocation.setAction(new LoginAction());
		List<Interceptor> list = new ArrayList<Interceptor>();
		list.add(new FirstInterceptor());
		list.add(new SecondInterceptor());
		list.add(new ThirdInterceptor());
		actionInvocation.setInterceptors(list.iterator());
		actionInvocation.setProxy(this);
		return actionInvocation.invoke();
	}
	
	public Result getResult(String resultCode){
//		manager.findResult(resultCode);
		System.out.println("根据resultCode创建Result对象:"+resultCode);
		return new SuccessResult();
	}

}
